Optimal. Leaf size=66 \[ \frac {a A c^2 \tan (e+f x)}{f}-\frac {a (i A-B) c^2 \tan ^2(e+f x)}{2 f}-\frac {i a B c^2 \tan ^3(e+f x)}{3 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.051, Rules used = {3669, 45}
\begin {gather*} -\frac {a c^2 (-B+i A) \tan ^2(e+f x)}{2 f}+\frac {a A c^2 \tan (e+f x)}{f}-\frac {i a B c^2 \tan ^3(e+f x)}{3 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 45
Rule 3669
Rubi steps
\begin {align*} \int (a+i a \tan (e+f x)) (A+B \tan (e+f x)) (c-i c \tan (e+f x))^2 \, dx &=\frac {(a c) \text {Subst}(\int (A+B x) (c-i c x) \, dx,x,\tan (e+f x))}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (A c+(-i A+B) c x-i B c x^2\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {a A c^2 \tan (e+f x)}{f}-\frac {a (i A-B) c^2 \tan ^2(e+f x)}{2 f}-\frac {i a B c^2 \tan ^3(e+f x)}{3 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.90, size = 109, normalized size = 1.65 \begin {gather*} \frac {a c^2 \sec (e) \sec ^3(e+f x) (3 (-i A+B) \cos (f x)+3 (-i A+B) \cos (2 e+f x)+6 A \sin (f x)-3 A \sin (2 e+f x)-3 i B \sin (2 e+f x)+3 A \sin (2 e+3 f x)+i B \sin (2 e+3 f x))}{12 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 49, normalized size = 0.74
method | result | size |
derivativedivides | \(-\frac {i a \,c^{2} \left (\frac {B \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {\left (i B +A \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2}+i A \tan \left (f x +e \right )\right )}{f}\) | \(49\) |
default | \(-\frac {i a \,c^{2} \left (\frac {B \left (\tan ^{3}\left (f x +e \right )\right )}{3}+\frac {\left (i B +A \right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2}+i A \tan \left (f x +e \right )\right )}{f}\) | \(49\) |
risch | \(\frac {2 a \,c^{2} \left (3 i A \,{\mathrm e}^{2 i \left (f x +e \right )}+3 B \,{\mathrm e}^{2 i \left (f x +e \right )}+3 i A -B \right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}\) | \(56\) |
norman | \(\frac {a A \,c^{2} \tan \left (f x +e \right )}{f}+\frac {\left (-i A a \,c^{2}+B a \,c^{2}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}-\frac {i a B \,c^{2} \left (\tan ^{3}\left (f x +e \right )\right )}{3 f}\) | \(64\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.51, size = 58, normalized size = 0.88 \begin {gather*} \frac {-2 i \, B a c^{2} \tan \left (f x + e\right )^{3} - 3 \, {\left (i \, A - B\right )} a c^{2} \tan \left (f x + e\right )^{2} + 6 \, A a c^{2} \tan \left (f x + e\right )}{6 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.61, size = 78, normalized size = 1.18 \begin {gather*} -\frac {2 \, {\left (3 \, {\left (-i \, A - B\right )} a c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} + {\left (-3 i \, A + B\right )} a c^{2}\right )}}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 117 vs. \(2 (56) = 112\).
time = 0.22, size = 117, normalized size = 1.77 \begin {gather*} \frac {6 i A a c^{2} - 2 B a c^{2} + \left (6 i A a c^{2} e^{2 i e} + 6 B a c^{2} e^{2 i e}\right ) e^{2 i f x}}{3 f e^{6 i e} e^{6 i f x} + 9 f e^{4 i e} e^{4 i f x} + 9 f e^{2 i e} e^{2 i f x} + 3 f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.65, size = 92, normalized size = 1.39 \begin {gather*} -\frac {2 \, {\left (-3 i \, A a c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - 3 \, B a c^{2} e^{\left (2 i \, f x + 2 i \, e\right )} - 3 i \, A a c^{2} + B a c^{2}\right )}}{3 \, {\left (f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, f e^{\left (4 i \, f x + 4 i \, e\right )} + 3 \, f e^{\left (2 i \, f x + 2 i \, e\right )} + f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.57, size = 50, normalized size = 0.76 \begin {gather*} \frac {a\,c^2\,\mathrm {tan}\left (e+f\,x\right )\,\left (6\,A-A\,\mathrm {tan}\left (e+f\,x\right )\,3{}\mathrm {i}+3\,B\,\mathrm {tan}\left (e+f\,x\right )-B\,{\mathrm {tan}\left (e+f\,x\right )}^2\,2{}\mathrm {i}\right )}{6\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________